import MainName from "@/components/login/Main"
import VueRouter from "vue-router";
import LoginName from "@/components/login/Login";
import Home from "@/views/Home";
import User from '@/components/permission/user'
import UserInfo from '@/components/permission/UserInfo'
import UserUpdate from '@/components/permission/UserUpdate'
import Permission from '@/components/permission/Permission'
import Role from "@/components/permission/Role";
import Registered from "@/components/login/Registered"
import List from "@/components/automobile/list"
import Save from "@/components/automobile/save"
import Import from '@/components/automobilecategory/import'
import Table from '@/components/automobilecategory/table'
import Create from '@/components/statisticscount/create'
import Show from '@/components/statisticscount/show'
import Update from '@/components/automobile/update'

import Vue from "vue";

Vue.use(VueRouter)

export default new VueRouter({

    //登录
    routes: [{
        path: '/',
        name: 'LoginName',
        component: LoginName,
    },
        //注册
        {
            path: '/registered',
            name: 'Registered',
            component: Registered
        },
        //页面布局
        {
            path: '/main',
            name: 'MainName',
            component: MainName,
            //首页
            children: [
                {
                    path: '/home',
                    name: 'HomeName',
                    meta: {
                        requireAuth: true,//判断是否需要登录
                    },
                    component: Home
                },
                //汽车列表
                {
                    path: '/list',
                    name: 'ListName',
                    meta: {
                        requireAuth: true,//判断是否需要登录
                    },
                    component: List
                },
                //添加汽车
                {
                    path: '/save',
                    name: 'SaveName',
                    meta: {
                        requireAuth: true,//判断是否需要登录
                    },
                    component: Save
                },
                //修改汽车
                {
                    path: '/update/:id',
                    name: 'UpdateName',
                    meta: {
                        requireAuth: true,//判断是否需要登录
                    },
                    component: Update
                },
                //导入汽车分类
                {
                    path: '/import',
                    name: 'ImportName',
                    meta: {
                        requireAuth: true,//判断是否需要登录
                    },
                    component: Import
                },
                //汽车分类列表
                {
                    path: '/table',
                    name: 'TableName',
                    meta: {
                        requireAuth: true,//判断是否需要登录
                    },
                    component: Table
                },
                //生成数据
                {
                    path: '/create',
                    name: 'CreateName',
                    meta: {
                        requireAuth: true,//判断是否需要登录
                    },
                    component: Create
                },
                //图标显示
                {
                    path: '/show',
                    name: 'ShowName',
                    meta: {
                        requireAuth: true,//判断是否需要登录
                    },
                    component: Show
                },
                //用户管理
                {
                    path: '/user',
                    name: 'UserName',
                    meta: {
                        requireAuth: true, //判断是否需要登录
                    },
                    component: User
                },
                {
                    path: '/userInfo',
                    name: 'UserInfo',
                    meta: {
                        requireAuth: true,
                    },
                    component: UserInfo
                },
                {
                    path: '/userUpdate',
                    name: 'UserUpdate',
                    meta: {
                        requireAuth: true,
                    },
                    component: UserUpdate
                },
                //角色管理
                {
                    path: '/role',
                    name: 'RoleName',
                    meta: {
                        requireAuth: true,
                    },
                    component: Role
                },
                //权限管理
                {
                    path: '/permissions',
                    name: 'PermissionName',
                    meta: {
                        requireAuth: true,
                    },
                    component: Permission
                }
            ]
        }
    ]
})
